<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function Persoon(name, age, sex) {
            this.name = name;
            this.age = age;
            this.sex = sex;
            this.sayHi = function () {
                console.log('构造函数上的你好');
            }
        }
        function Person(name,age,sex) {
            this.name =name;
            this.age = age;
            this.sex =sex;
            this.sayHi = function () {
                console.log('构造函数上的你好');
            }
        }
        Person.prototype.sayHi = function () {
            console.log('原型上的你好');
        }
        Person.prototype.sayHi = function () {
            console.log('原型上的你好');
        }
        Person.prototype.sayHi = function () {
            console.log('原型上的你好');
        }
        var yq = new Person('于谦', 40, '女');
        var yq = new Person('于谦', 50, '女');
        var yq = new Person('于谦', 50, '女');
        console.log(yq.sex);
        ya.sayHi();
        ya.sayHi();
        ya.sayHi();
        // 通过实例对象 访问属性和方法，如果该对象的构造函数中有刻属性就访问并获取
        // 如果没有就去刻对象的构造函数的原型中寻找，如果还没有找到相似undefined
    </script>
</body>
</html>